#include <iostream>
using namespace std;

using ElemType = char;
#define MaxSize 100


class Queue {
	ElemType data[MaxSize];
	int front = 0;
	int rear = 0;
	
public:
	Queue() {} 
	
	bool full() {
		return (rear + 1) % MaxSize == front;
	}
	
	bool empty() {
		return rear == front;
	}
	
	bool push(ElemType e) {
		if (full()) return false;
		rear = (rear + 1) % MaxSize;
		data[rear] = e;
		return true;
	}
	
	bool pop() {
		if (empty()) return false;
		front = (front + 1) % MaxSize;
		return false;
	}
	
	ElemType top() {
		return data[(front + 1) % MaxSize];
	}
	
	int size() {
		return (rear - front + MaxSize) % MaxSize;
	}
}; 

int main() {
	Queue q;
	q.push('h');
	q.push('e');
	q.push('l');
	q.push('l');
	q.push('o');
	cout << q.size() << endl;
	
	while (!q.empty()) {
		cout << q.top() << endl;
		q.pop();
	} 
}
